package com.multidb.annotationdemo.service;


import com.baomidou.dynamic.datasource.annotation.DS;
import com.multidb.annotationdemo.dao.order.OrderDao;
import com.multidb.annotationdemo.entity.order.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service

public class OrderService {

    @Autowired
    OrderDao orderDao;

    public Order getOrder() {
        return orderDao.selectByPrimaryKey(1L);
    }


    public int insert() {
        Order order = new Order();
        order.setOrderSn("66666");
        order.setCreateTime(new Date());
        return orderDao.insert(order);
    }

}
